<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html >
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>登录界面</title>
          <meta name="viewport" content="width=device-width, initial-scale=1">
      </head>


      <body  style="width: 100%;height: 60%;">
      <script src="/approval/static/js/jquery-3.4.1.min.js"></script>
      <script src="/approval/static/js/vue-2.4.0.js"></script>
      <link type="text/css" rel="stylesheet" href="/approval/static/css/bootstrap.min.css"/>
      <div id="app" class="container panel panel-default" style="width: 40%;margin-top: 50px;">

          <div class=" panel-body">

          <form class="form-horizontal " action="http://localhost:8080/approvalProcess/SignIn" method="GET" id="form_login">
              <div class="form-group">

                  <label for="account" class="col-sm-2 control-label">{{ms_aco}}</label>
                  <div class="col-sm-10">
                      <input type="text" v-model="account" class="form-control" id="account" placeholder="account">
                  </div>
              </div>
              <div class="form-group">
                  <label for="password" class="col-sm-2 control-label">{{ms_ps}}</label>
                  <div class="col-sm-10">
                      <input type="password" v-model="password" class="form-control" id="password" placeholder="Password">
                  </div>
              </div>
              <div class="form-group">
                  <div class="col-sm-offset-2 col-sm-10">
                      <button type="button" id="bt_login" v-on:click="Login"   class="btn btn-lg btn-primary btn-block">{{ms_si}}</button>
                  </div>
              </div>
          </form>
         </div>
      </div>
            <script type="text/javascript">
                var app=new Vue({
                    el:"#app",
                    data:{
                        ms_aco:"账户",
                        ms_ps:"密码",
                        ms_si:"登录",
                        account:"",
                        password:""
                    },
                    methods:{
                        Login:function (){
                            alert("触发了按钮");
                           $.ajax({
                               url:"/approval/certificate/tologin",
                               type:"POST",
                               data: {
                                   account: this.account,
                                   password: this.password
                               },
                               dataType:"text",
                               success:function (res){
                                   alert(res)
                                   if(res==null||res=="false"){
                                       alert("你的信息输入有误！请重新输入");

                                       this.account=this.password="";
                                   }else {

                                       window.location="Main_Stuff.html";

                                   }

                               }
                           })
                        }
                    }
                });


            </script>
      </body>
</html>